<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>铝邦CRM客户管理系统</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-datetimepicker.min.css"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/setting.css"/>
    <script src="js/jquery-1.12.3.min.js"></script>
    <script src="layui/layui.all.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<div class="main-nav">
    <h3>跟进记录</h3>
    <div class="all-client all-clues clues-on col-sm-1">全部记录</div>
    <div class="import-clues col-sm-1">导出全部</div>
</div>
<!--搜索-->
<div class="clues-search">
    <label class="search-label label-left-lg">写跟进时间：</label>
    <select id="wfollowTime" class="search-select">
        <option value="0">---全部---</option>
        <option value="1">今天</option>
        <option value="2">昨天</option>
        <option value="3">本周</option>
    </select>
    <input id="followTimeStart" class="span2 datetimepicker modal-input-sm start" size="16" type="text" value="">-
    <input id="followTimeEnd" class="span2 datetimepicker modal-input-sm end" size="16" type="text" value="">
    <label class="search-label label-left-sm">所属模块：</label>
    <select id="belmModal" class="search-select">
        <option value="0">---全部---</option>
        <option value="1">线索</option>
        <option value="2">代理</option>
    </select>
    <label class="search-label label-left-sm">跟进类型：</label>
    <select id="followType" class="search-select">
        <option value="0">---全部---</option>
        <option value="1">电话</option>
        <option value="2">微信</option>
    </select>
    <label class="search-label label-left-sm">负责客服：</label>
    <select id="responService" class="search-select">
        <option value="0">---部门---</option>
        <option value="1">未指派</option>
        <option value="2">客服</option>
    </select>
    <select id="serviceUser" class="search-select">
        <option value="0">---用户---</option>
        <option value="1">思远</option>
        <option value="2">阿曼</option>
    </select>
    <div class="clear-many"><a href="follow-news.html">清空</a></div>
</div>
<!--跟进记录-->
<div class="main-right follow-all">
    <div class="follow-msg-box">
        <?php foreach($followInfosList as $value){

            ?>
            <div class="follow-msg-wap">
                <span class="list-boll"></span>
                <div class="follow-time"><?=date('m-d',$value['addTime'])?></div>
                <div class="follow-sys">
                    <label>跟进人：</label>
                    <span><?=$value['users']['userName']?></span>
                    <span> > </span>
                    <span><?=$value['followType']['name']?></span>
                    <div class="clear"></div>
                    <span><?=$value['followContent']?></span>
                    <div class="clear"></div>
                    <label for="">配合程度：</label>
                    <span><?=$value['coordinationDegree']['name']?></span>
                    <div class="clear"></div>
                    <label for="">跟进状态：</label>
                    <span><?=$value['followStatus']['name']?></span>
                    <div class="clear"></div>
                    <label for="">跟进时间：</label>
                    <span><?=date('Y-m-d H:i',$value['followTime'])?></span>
                    <div class="clear"></div>
                    <div class="sys-del">删除</div>
                </div>
            </div>
            <?php
        }
        ?>

    </div>
</div>
<script>
    $(function () {
        $(".span2").datetimepicker({
            language:'zh-CN',//中文显示日期
            format:'yyyy-mm-dd',//显示为年：月：日 时：分
            weekStart:1,//星期一为一周开始
            todayBtn:true,//可以选择当前时间
            autoclose:true,//自动关闭
            todayHighlight:true,//今天高亮
            startView:2,
            forceParse:true,  //输入错误的时间时，会强制解析
            showMeridian:true, //启用子午线视图？不知道什么鬼
            minuteStep:5    //最小分钟数，设置为5
        });
        $(".start").datetimepicker().on("click",function(){
            $(this).datetimepicker("setEndDate",$(".end").val())
        });
        $(".end").datetimepicker().on("click",function(){
            $(this).datetimepicker("setStartDate",$(".start").val())
        });
        function dateIndex(){
            var date = new Date();
            var y = date.getFullYear();
            var mm = date.getMonth()+1;
            var m = date.getMonth()+1;
            var d = date.getDate();
            var dd= date.getDate()-7;
            if(dd<=0){
                if(m == 4 || m == 6 || m == 9 || m == 11){
                    mm = mm-1;
                    dd = 30+dd;
                }else if(mm == 2){
                    mm = mm-1;
                    dd = 28+dd;
                }else{
                    mm = mm-1;
                    dd = 31+dd;
                }
            }
            var time = y+"-"+m+"-"+d;
            var timeo= y+"-"+mm+"-"+dd;
            $(".start").val(timeo);
            $(".end").val(time);
        }
//        dateIndex();
        //搜索时执行
        $(".clues-search select,.clues-search input.end").change(function () {
            var params={};
            params.wfollowTime = $("#wfollowTime").val();
            params.followTimeStart = $("#followTimeStart").val();
            params.followTimeEnd = $("#followTimeEnd").val();
            params.belmModal = $("#belmModal").val();
            params.followType = $("#followType").val();
            params.responService = $("#responService").val();
            params.serviceUser = $("#serviceUser").val();
            var url = '';
            $.post(url,params, function () {
                error:{
                    layer.msg("失败");
                }
            })
        });
    })
</script>
</body>
</html>